package com.bilibili.xzz.controller;

import com.bilibili.xzz.entity.Video;
import com.bilibili.xzz.service.VideoService;
import com.bilibili.xzz.utils.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;


@RestController
@RequestMapping("/api/video")
public class VideoController {

    @Resource
    VideoService videoService;

    @PostMapping("/info")
    public Result Video() {
        try {
            List<Video> videoList = videoService.getAllVideo();
            return Result.ok().data("info", videoList);
        } catch (Exception e) {
            return Result.error().data("msg", "获取视频信息失败");
        }

    }
}
